package com.joysuch.wwyt.risk.entity;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;

import static javax.persistence.GenerationType.IDENTITY;

@Data
@EntityListeners({AuditingEntityListener.class, AutoSetCommonFieldListener.class})
@Entity
@Table(name = "wwyt_risk_point_business_evaluation_detail")
@SQLDelete(sql = "update wwyt_risk_point_business_evaluation_detail set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update wwyt_risk_point_business_evaluation_detail set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")
public class RiskPointEvaluationDetail implements Serializable {
    @Id
    @GeneratedValue(strategy = IDENTITY)
    @ApiModelProperty("id")
    private Long id;

    @ApiModelProperty("风险点id")
    private Long riskPointId;

    @ApiModelProperty("风险点类别:null风险点;1风险点库")
    private Integer shared;

    @ApiModelProperty("0风险点固有风险评价,1风险点控制风险评价")
    private Integer pointAnalyzeType;

    @ApiModelProperty("分析方法id")
    private Long analyzeWayId;

    @ApiModelProperty("评估id")
    private Long pointEvaluationId;

    @ApiModelProperty("风险辨识评估id")
    private Long itemId;

    @ApiModelProperty("类型:0分析方法选项,1评估方法选项,2数据字典")
    private Integer methodAnalyzeType;

    @ApiModelProperty("选项id")
    private Long methodId;

    @ApiModelProperty("0文本/乘数,1下拉选/乘积")
    private Integer contentType;

    @ApiModelProperty("所选指标选项id")
    private Long targetItemId;

    @ApiModelProperty("文本内容")
    private String content;

    // @ApiModelProperty("管控层级id")
    // private Long controlLevelId;
    //
    // @ApiModelProperty("责任单位id")
    // private Long responseDepartId;
    //
    // @ApiModelProperty("责任人id")
    // private Long responseUserId;

    @ApiModelProperty("管控层级id")
    private String controlLevelIds;

    @ApiModelProperty("责任单位id")
    private String responseDepartIds;

    @ApiModelProperty("责任人id")
    private String responseUserIds;

    @ApiModelProperty("管控状态:1已分级,2未分级")
    private Integer controlState;


    //通用字段
    @ApiModelProperty("创建人")
    @org.springframework.data.annotation.CreatedBy
    private Long createBy;

    @ApiModelProperty("创建时间")
    @org.springframework.data.annotation.CreatedDate
    private java.time.LocalDateTime createTime;

    @ApiModelProperty("更新人")
    @org.springframework.data.annotation.LastModifiedBy
    private Long updateBy;

    @ApiModelProperty("更新时间")
    @org.springframework.data.annotation.LastModifiedDate
    private java.time.LocalDateTime updateTime;

    @ApiModelProperty("租户")
    private Long tenentId;

    @ApiModelProperty("组织机构代码")
    private String orgCode;

    @ApiModelProperty("删除标记")
    private String deleteFlag;
}
